<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>gml.gml_graph</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://pedram.redhive.com">Process&nbsp;Stalker&nbsp;--&nbsp;Instrumentation&nbsp;API</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        <a href="gml-module.html">Module&nbsp;gml</a> ::
        Class&nbsp;gml_graph
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[<a href="../private/gml.gml_graph-class.html">show&nbsp;private</a>&nbsp;|&nbsp;hide&nbsp;private]</font></td></tr>
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="gml.gml_graph-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF CLASS DESCRIPTION =========== -->
<h2 class="class">Class gml_graph</h2>

<hr/>

This class ties together the node, edge and cluster classes into an 
abstracted graph object. The class is also capable of parsing a GML file 
into the relevant components and storing them within internal lists. The 
render() routine should be used for returning a graph description 
suitable for writing into a GML file. The render_to_file(), routine is a 
convenience function that should be used for saving a graph description 
rendering to disk.
<hr/>


<!-- =========== START OF METHOD SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Method Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>uid_start</span>)</span></code>
<br />
Initialize internal member variables.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#__module_test__" class="summary-sig-name"><code>__module_test__</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Run a few basic tests to ensure the class is working.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Bool
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#add_cluster" class="summary-sig-name"><code>add_cluster</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>cluster</span>)</span></code>
<br />
Adds a cluster object to internal cluster list.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Bool
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#add_edge" class="summary-sig-name"><code>add_edge</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>edge</span>)</span></code>
<br />
Adds an edge object to internal edges list.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Bool
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#add_node" class="summary-sig-name"><code>add_node</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>node</span>)</span></code>
<br />
Adds a node object to internal nodes list.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#del_cluster" class="summary-sig-name"><code>del_cluster</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>)</span></code>
<br />
Delete a cluster from the internal list by it's index.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#del_edge" class="summary-sig-name"><code>del_edge</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>)</span></code>
<br />
Delete an edge from the internal list by it's index.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#del_node" class="summary-sig-name"><code>del_node</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>)</span></code>
<br />
Delete a node from the internal list by it's index.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        gml_cluster
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#find_cluster_by_node_id" class="summary-sig-name"><code>find_cluster_by_node_id</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>node_id</span>)</span></code>
<br />
Locate the cluster that contains the specified node ID.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        gml_node
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#find_node_by_address" class="summary-sig-name"><code>find_node_by_address</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>node_address</span>)</span></code>
<br />
Locate the node with the specified node address within in the internal 
list.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        gml_node
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#find_node_by_id" class="summary-sig-name"><code>find_node_by_id</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>node_id</span>)</span></code>
<br />
Locate the node with the specified node ID within in the internal 
list.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        gml_cluster
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#get_cluster" class="summary-sig-name"><code>get_cluster</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>)</span></code>
<br />
Return the cluster at the specified index.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        gml_edge
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#get_edge" class="summary-sig-name"><code>get_edge</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>)</span></code>
<br />
Return the edge at the specified index.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        gml_node
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#get_node" class="summary-sig-name"><code>get_node</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>)</span></code>
<br />
Return the node at the specified index.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Integer
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#num_clusters" class="summary-sig-name"><code>num_clusters</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Return the cluster count for the graph.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Integer
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#num_edges" class="summary-sig-name"><code>num_edges</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Return the edge count for the graph.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Integer
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#num_nodes" class="summary-sig-name"><code>num_nodes</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Return the node count for the graph.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#parse" class="summary-sig-name"><code>parse</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>gml_definition</span>)</span></code>
<br />
Open the specified GML file and parse out the node, edge and cluster 
components.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#parse_file" class="summary-sig-name"><code>parse_file</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>filename</span>)</span></code>
<br />
Open the specified GML file and parse out the node, edge and cluster 
components.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#parser_define" class="summary-sig-name"><code>parser_define</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Define the pyparsing GML parser definition.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#parser_strip_quotes" class="summary-sig-name"><code>parser_strip_quotes</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>original_string</span>,
          <span class=summary-sig-arg>location</span>,
          <span class=summary-sig-arg>tokens</span>)</span></code>
<br />
This routine is used to strip quotes from matched GML element 
strings.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#process_cluster" class="summary-sig-name"><code>process_cluster</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>original_string</span>,
          <span class=summary-sig-arg>location</span>,
          <span class=summary-sig-arg>tokens</span>)</span></code>
<br />
This routine is called upon successful matching of cluster elements 
and is protyped as per the pyparsing specification.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#process_edge" class="summary-sig-name"><code>process_edge</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>original_string</span>,
          <span class=summary-sig-arg>location</span>,
          <span class=summary-sig-arg>tokens</span>)</span></code>
<br />
This routine is called upon successful matching of edge elements and 
is protyped as per the pyparsing specification.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#process_node" class="summary-sig-name"><code>process_node</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>original_string</span>,
          <span class=summary-sig-arg>location</span>,
          <span class=summary-sig-arg>tokens</span>)</span></code>
<br />
This routine is called upon successful matching of node elements and 
is protyped as per the pyparsing specification.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        String
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#render" class="summary-sig-name"><code>render</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Render the GML graph description.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#render_to_file" class="summary-sig-name"><code>render_to_file</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>filename</span>)</span></code>
<br />
Render the entire GML graph description.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        Bool
</font></td>
  <td><code><span class="summary-sig"><a href="gml.gml_graph-class.html#replace_node" class="summary-sig-name"><code>replace_node</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>index</span>,
          <span class=summary-sig-arg>node</span>)</span></code>
<br />
Adds a node object to internal nodes list.</td></tr>
</table><br />


<!-- =========== START OF METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Method Details</th></tr>
</table>

<a name="__init__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>uid_start</span>=<span class=sig-default>0</span>)</span>
    <br /><i>(Constructor)</i>
  </h3>
  Initialize internal member variables.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>uid_start</b></code> -
         Optional number to start generating unique node ID's from.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="__module_test__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__module_test__</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  Run a few basic tests to ensure the class is working.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="add_cluster"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">add_cluster</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>cluster</span>)</span>
  </h3>
  Adds a cluster object to internal cluster list.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>cluster</b></code> -
         Cluster object
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_cluster)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        True on success, False otherwise.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Bool)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="add_edge"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">add_edge</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>edge</span>)</span>
  </h3>
  Adds an edge object to internal edges list.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>edge</b></code> -
         Edge object
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_edge)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        True on success, False otherwise.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Bool)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="add_node"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">add_node</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>node</span>)</span>
  </h3>
  Adds a node object to internal nodes list.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>node</b></code> -
         Node object
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_node)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        True on success, False otherwise.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Bool)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="del_cluster"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">del_cluster</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>)</span>
  </h3>
  Delete a cluster from the internal list by it's index.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Cluster index
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="del_edge"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">del_edge</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>)</span>
  </h3>
  Delete an edge from the internal list by it's index.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Edge index
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="del_node"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">del_node</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>)</span>
  </h3>
  Delete a node from the internal list by it's index.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Node index
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="find_cluster_by_node_id"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">find_cluster_by_node_id</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>node_id</span>)</span>
  </h3>
  Locate the cluster that contains the specified node ID.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>node_id</b></code> -
         Node ID to search the cluster list for.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Found cluster or 'False' if not found
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_cluster)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="find_node_by_address"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">find_node_by_address</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>node_address</span>)</span>
  </h3>
  Locate the node with the specified node address within in the 
  internal list.
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Found node or 'False' if not found
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_node)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="find_node_by_id"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">find_node_by_id</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>node_id</span>)</span>
  </h3>
  Locate the node with the specified node ID within in the internal 
  list.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>node_id</b></code> -
         Node ID to search for
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Found node or 'False' if not found
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_node)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="get_cluster"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">get_cluster</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>)</span>
  </h3>
  Return the cluster at the specified index.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Index of cluster to return.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Cluster at specified index.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_cluster)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>psx</b></code> -
        An exception is raisd if the requested index is out of 
        range.
    </dl>
  </dd></dl>
</td></tr></table>

<a name="get_edge"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">get_edge</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>)</span>
  </h3>
  Return the edge at the specified index.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Index of edge to return.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Edge at specified index.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_edge)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>psx</b></code> -
        An exception is raisd if the requested index is out of 
        range.
    </dl>
  </dd></dl>
</td></tr></table>

<a name="get_node"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">get_node</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>)</span>
  </h3>
  Return the node at the specified index.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Index of node to return.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Node at specified index.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_node)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>psx</b></code> -
        An exception is raisd if the requested index is out of 
        range.
    </dl>
  </dd></dl>
</td></tr></table>

<a name="num_clusters"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">num_clusters</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  Return the cluster count for the graph.
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Number of defined clusters in this graph.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="num_edges"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">num_edges</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  Return the edge count for the graph.
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Number of defined edges in this graph.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="num_nodes"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">num_nodes</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  Return the node count for the graph.
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Number of defined nodes in this graph.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="parse"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">parse</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>gml_definition</span>)</span>
  </h3>
  Open the specified GML file and parse out the node, edge and cluster 
  components.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>gml_definition</b></code> -
         GML description to parse
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>psx</b></code> -
        An exception is raised if parsing fails for any reason.
    </dl>
  </dd></dl>
</td></tr></table>

<a name="parse_file"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">parse_file</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>filename</span>)</span>
  </h3>
  Open the specified GML file and parse out the node, edge and cluster 
  components.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>filename</b></code> -
         GML file to parse
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>psx</b></code> -
        An exception is raised if parsing fails for any reason.
    </dl>
  </dd></dl>
</td></tr></table>

<a name="parser_define"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">parser_define</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  Define the pyparsing GML parser definition. This is my first 
  experience with the pyparsing module, improvements are welcome.
  <dl><dt></dt><dd>
<p><b>To Do:</b> Modify parser definition such that attribute order is not 
important.
</p>

  </dd></dl>
</td></tr></table>

<a name="parser_strip_quotes"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">parser_strip_quotes</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>original_string</span>,
          <span class=sig-arg>location</span>,
          <span class=sig-arg>tokens</span>)</span>
  </h3>
  This routine is used to strip quotes from matched GML element 
  strings.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>original_string</b></code> -
         The original parse string
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      <dd><code><b>location</b></code> -
         The location in the string where matching started
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      <dd><code><b>tokens</b></code> -
         The list of matched tokens
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=ParseResults Object)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="process_cluster"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">process_cluster</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>original_string</span>,
          <span class=sig-arg>location</span>,
          <span class=sig-arg>tokens</span>)</span>
  </h3>
  This routine is called upon successful matching of cluster elements 
  and is protyped as per the pyparsing specification.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>original_string</b></code> -
         The original parse string
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      <dd><code><b>location</b></code> -
         The location in the string where matching started
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      <dd><code><b>tokens</b></code> -
         The list of matched tokens
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=ParseResults Object)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="process_edge"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">process_edge</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>original_string</span>,
          <span class=sig-arg>location</span>,
          <span class=sig-arg>tokens</span>)</span>
  </h3>
  This routine is called upon successful matching of edge elements and 
  is protyped as per the pyparsing specification.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>original_string</b></code> -
         The original parse string
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      <dd><code><b>location</b></code> -
         The location in the string where matching started
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      <dd><code><b>tokens</b></code> -
         The list of matched tokens
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=ParseResults Object)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="process_node"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">process_node</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>original_string</span>,
          <span class=sig-arg>location</span>,
          <span class=sig-arg>tokens</span>)</span>
  </h3>
  This routine is called upon successful matching of node elements and 
  is protyped as per the pyparsing specification.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>original_string</b></code> -
         The original parse string
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      <dd><code><b>location</b></code> -
         The location in the string where matching started
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      <dd><code><b>tokens</b></code> -
         The list of matched tokens
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=ParseResults Object)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="render"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">render</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  Render the GML graph description.
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        GML graph description
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="render_to_file"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">render_to_file</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>filename</span>)</span>
  </h3>
  Render the entire GML graph description.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>filename</b></code> -
         Filename to stored rendered GML definition to.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=String)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>psx</b></code> -
        An exception is raised if the specified file can not be opened 
        for writing.
    </dl>
  </dd></dl>
</td></tr></table>

<a name="replace_node"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">replace_node</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>index</span>,
          <span class=sig-arg>node</span>)</span>
  </h3>
  Adds a node object to internal nodes list.
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>index</b></code> -
         Node index
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Integer)</i>
      <dd><code><b>node</b></code> -
         Node object
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=gml_node)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        True on success, False otherwise.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=Bool)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://pedram.redhive.com">Process&nbsp;Stalker&nbsp;--&nbsp;Instrumentation&nbsp;API</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Tue Jul 05 12:05:31 2005</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
